package com.pt.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserStatus {
    DISABLED(0, "禁用"),
    NORMAL(1, "正常"),
    UNVERIFIED(2, "未验证"),
    ASSESSMENT(3, "考核中");

    private final int code;
    private final String desc;

    public static UserStatus getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        
        for (UserStatus status : UserStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        return null;
    }
} 